<?php

class sfGuardFormSignin extends sfForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'username' => new sfWidgetFormInput(),
      'password' => new sfWidgetFormInput(array('type' => 'password')),
      'remember' => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'username' => new sfValidatorString(array('required' => true), array('required' => 'Campo obligatorio')),
      'password' => new sfValidatorString(array('required' => true), array('required' => 'Campo obligatorio')),
      'remember' => new sfValidatorBoolean(),
    ));

    $this->validatorSchema->setPostValidator(new sfGuardValidatorUser(array(), array('invalid' => 'El usuario o la clave son inválidos')));

    $this->widgetSchema->setNameFormat('signin[%s]');

    $this->widgetSchema->setLabels(array (
       'username'  =>  'Usuario',
       'password'  =>  'Contraseña',
       'remember'  =>  'Recordar',
    ));
  }
}
